<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<%-- 模拟用户是否登录, 显示不同界面--%>

<c:if test="${1<2}" var="x" scope="request">
    真
</c:if>

${sessionScope.x}

<%
    // 模拟用户登录
    //session.setAttribute("username","jack");
%>

<c:if test="${empty username}">
    <a href="#">登录</a>
</c:if>

<c:if test="${not empty username}">
    <a href="#">添加</a>
    <a href="#">查询</a>
</c:if>


</body>
</html>
